<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script src="https://s3.pstatp.com/cdn/expire-1-M/jquery/3.3.1/jquery.min.js"></script>
	</head>
	<body>
		拉勾手机
		<button onclick="seckill('lagouPhone')">秒杀</button>
		
	</body>
	
</html>

<script type="text/javascript">
	
	localStorage.setItem("userId","123");
	
	function seckill(productId){
		let userId = localStorage.getItem("userId");
		
		$.ajax({
				url: 'http://127.0.0.1:8080/seckill/createOrder?userId='+userId+'&productId='+productId,
				type: 'GET',
				success: function (data) {
					alert("已抢购，请查看订单详情")
				}
			})
	}
</script>
